<!DOCTYPE html>
<html lang="zh">
{include file="public/head"}
  
<body>
<div class="container-fluid">
  
  <div class="row">
    
    <div class="col-lg-12">
      <div class="card">
        <header class="card-header"><div class="card-title">网站配置</div></header>
        <div class="card-body">
          
          <ul class="nav nav-tabs">
            <li class="nav-item">
              <button class="nav-link active" id="basic-config" data-bs-toggle="tab" data-bs-target="#config" type="button" >基本</button>
            </li>
            <li class="nav-item">
              <button class="nav-link" id="basic-upload" data-bs-toggle="tab" data-bs-target="#upload" type="button">上传</button>
            </li>
          </ul>
            <div class="tab-content">
              <!-- tab_1 -->
              <div class="tab-pane fade show active" id="config" aria-labelledby="basic-config">
              <form class="row" id="common_form" action="{$action}" method="post">
                <div class="mb-3">
                  <label for="site_name" class="form-label">网站标题</label>
                  <input class="form-control" type="text" id="site_name" name="site_name" value="{$info.site_name}" placeholder="请输入站点标题">
                  <!-- <small class="form-text">调用方式：<code>config('site_name')</code></small> -->
                </div>
                <div class="mb-3">
                  <label for="web_site_logo" class="form-label">LOGO图片</label>
                  <img src="{$info.logo}" style="width: 230px;height: 36px" class="show_upload_file">
                  <div class="input-group">
                    <input type="text" class="form-control file_path_value" name="logo" value="{$info.logo}">
                    <!-- <button class="btn btn-default" type="button">上传图片</button> -->
                    <button class="btn btn-default" type="button" onclick="openLayer('选择图片', '/admin/common/selectImage',100,100)">选择图片</button>
                  </div>
                </div>
                <div class="mb-3">
                  <label for="keyword" class="form-label">站点关键词</label>
                  <input class="form-control" type="text" id="keyword" name="keyword" value="{$info.keyword}" placeholder="请输入站点关键词">
                  <small class="form-text">网站搜索引擎关键字</small>
                </div>
                <div class="mb-3">
                  <label for="describe" class="form-label">站点描述</label>
                  <textarea class="form-control" id="describe" rows="5" name="describe" placeholder="请输入站点描述">{$info.describe}</textarea>
                  <small class="form-text">网站描述，有利于搜索引擎抓取相关信息</small>
                </div>
                <div class="mb-3">
                  <label for="copyright" class="form-label">版权信息</label>
                  <input class="form-control" type="text" id="copyright" name="copyright" value="{$info.copyright}" placeholder="请输入版权信息">
                  <!-- <small class="form-text">调用方式：<code>config('copyright')</code></small> -->
                </div>
                <div class="mb-3">
                  <label for="site_icp" class="form-label">备案信息</label>
                  <input class="form-control" type="text" id="site_icp" name="site_icp" value="{$info.site_icp}" placeholder="请输入备案信息">
                  <!-- <small class="form-text">调用方式：<code>config('site_icp')</code></small> -->
                </div>
                <div class="mb-3">
                  <label class="form-label">站点开关</label>
                  <div class="clearfix">
                <div class="form-check form-check-inline">
                  <input type="radio" id="site_status" name="site_status" class="form-check-input" value="1" {if $info.site_status == 1}checked{/if}>
                  <label class="form-check-label" for="site_status">启用</label>
                </div>
                <div class="form-check form-check-inline">
                  <input type="radio" id="site_status" name="site_status" class="form-check-input" value="0" {if $info.site_status == 0}checked{/if}>
                  <label class="form-check-label" for="site_status">不启用</label>
                </div>
              </div>
                  <small class="form-text">站点关闭后将不能访问，后台可正常登录</small>
                </div>
                <div>
                  <!-- <input type="hidden" id="jump_url" value="{$action}"> -->
                  <input type="hidden" name="tab" value="tab1">
                  <button type="submit" class="btn btn-primary ajax-post" target-form="add-form">确 定</button>
                  <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
                </div>
              </form>
              </div>
              <!-- tab_1 end -->

              <div class="tab-pane fade" id="upload" aria-labelledby="basic-upload">
                <form class="row" id="common_form" action="{$action}" method="post">
                <div class="mb-3 col-md-12">
                  <label for="status" class="form-label">当前文件上传存储位置</label>
                  <div class="clearfix">
                    <div class="form-check form-check-inline">
                      <input type="radio" id="upload_path" value="local" name="upload_path" class="form-check-input" {if $upload.upload_path == 'local'}checked{/if}>
                      <label class="form-check-label" for="upload_path">本地</label>
                    </div>
                    <div class="form-check form-check-inline">
                      <input type="radio" id="upload_path" value="ali" name="upload_path" class="form-check-input" {if $upload.upload_path == 'ali'}checked{/if}>
                      <label class="form-check-label" for="upload_path">阿里云</label>
                    </div>
                    <div class="form-check form-check-inline">
                      <input type="radio" id="upload_path" value="qn" name="upload_path" class="form-check-input" {if $upload.upload_path == 'qn'}checked{/if}>
                      <label class="form-check-label" for="upload_path">七牛云</label>
                    </div>
                  </div>
                </div>
                <div class="mb-3">
                  <label class="form-label">上传到三方存储是否删除本地文件</label>
                  <div class="clearfix">
                <div class="form-check form-check-inline">
                  <input type="radio" id="delete_local" name="delete_local" class="form-check-input" value="0" {if $upload.delete_local == 0}checked{/if}>
                  <label class="form-check-label" for="delete_local">不删除</label>
                </div>
                <div class="form-check form-check-inline">
                  <input type="radio" id="delete_local" name="delete_local" class="form-check-input" value="1" {if $upload.delete_local == 1}checked{/if}>
                  <label class="form-check-label" for="delete_local">删除</label>
                </div>
              </div>
                  <small class="form-text">删除后本地文件将不可访问</small>
                </div>
                <div class="mb-3 col-md-12">
                  <label for="file_ext" class="form-label">文件允许后缀名</label>
                  <input type="text" class="form-control" id="file_ext" name="file_ext" value="{$upload.file_ext}" placeholder="文件允许后缀名" />
                  <small class="form-text">多个后缀用逗号隔开，不填写则不限制类型</small>
                </div>
                <div class="mb-3">
                  <label for="upload_img_size" class="form-label">图片上传大小限制</label>
                  <input class="form-control" type="text" id="upload_img_size" name="upload_img_size" value="{$upload.upload_img_size}" placeholder="请输入图片上传大小限制" >
                  <small class="form-text">0为不限制大小，单位：kb</small>
                </div>
                <div class="mb-3">
                  <label for="upload_file_size" class="form-label">其他文件上传大小限制</label>
                  <input class="form-control" type="text" id="upload_file_size" name="upload_file_size" value="{$upload.upload_file_size}" placeholder="请输入其他文件上传大小限制" >
                  <small class="form-text">0为不限制大小，单位：kb</small>
                </div>
                <div class="mb-3">
                  <!-- <label for="upload_size" class="form-label">本地存储路径</label> -->
                  
                  <div class="row">
                    <div class="col">
                      <label for="inputZip" class="form-label">本地图片存储位置</label>
                      <input class="form-control" type="text" name="path_info[local][img_path]" value="{$upload.path_info.local.img_path}">
                      <small class="form-text">文件根路径为public文件夹</small>
                    </div>
                    <div class="col">
                      <label for="inputZip" class="form-label">其他文件存储位置</label>
                      <input class="form-control" type="text" name="path_info[local][other_path]" value="{$upload.path_info.local.other_path}">
                      <small class="form-text">文件根路径为public文件夹</small>
                    </div>
                    <div class="col">
                      <label for="inputZip" class="form-label">本地访问域名（一般为当前服务器域名）</label>
                      <input type="text" class="form-control" name="path_info[local][local_domain]" value="{$upload.path_info.local.local_domain}" aria-label="secret_key">
                    </div>
                  </div>
                </div>
                <div class="mb-3">
                  <label for="upload_size" class="form-label">阿里云配置</label>
                  <div class="row">
                    <div class="col">
                      <label for="inputZip" class="form-label">access_key</label>
                      <input type="text" class="form-control" name="path_info[ali][access_key]" value="{$upload.path_info.ali.access_key}" aria-label="access_key">
                    </div>
                    <div class="col">
                      <label for="inputZip" class="form-label">secret_key</label>
                      <input type="text" class="form-control" name="path_info[ali][secret_key]" value="{$upload.path_info.ali.secret_key}" aria-label="secret_key">
                    </div>
                    <div class="col">
                      <label for="inputZip" class="form-label">节点名称</label>
                      <input type="text" class="form-control" name="path_info[ali][endpoint]" value="{$upload.path_info.ali.endpoint}" aria-label="endpoint">
                    </div>
                    <div class="col">
                      <label for="inputZip" class="form-label">bucket</label>
                      <input type="text" class="form-control" name="path_info[ali][bucket]" value="{$upload.path_info.ali.bucket}" aria-label="bucket">
                    </div>
                  </div>
                </div>

                <div class="mb-3">
                  <label for="upload_size" class="form-label">七牛云配置</label>
                  <div class="row">
                    <div class="col">
                      <label for="inputZip" class="form-label">access_key</label>
                      <input type="text" class="form-control" name="path_info[qn][access_key]" value="{$upload.path_info.qn.access_key}" aria-label="access_key">
                    </div>
                    <div class="col">
                      <label for="inputZip" class="form-label">secret_key</label>
                      <input type="text" class="form-control" name="path_info[qn][secret_key]" value="{$upload.path_info.qn.secret_key}" aria-label="secret_key">
                    </div>
                    <div class="col">
                      <label for="inputZip" class="form-label">七牛CDN域名（*未添加则无法正常访问文件）</label>
                      <input type="text" class="form-control" name="path_info[qn][domain]" value="{$upload.path_info.qn.domain}" aria-label="domain">
                    </div>
                    <div class="col">
                      <label for="inputZip" class="form-label">bucket</label>
                      <input type="text" class="form-control" name="path_info[qn][bucket]" value="{$upload.path_info.qn.bucket}" aria-label="bucket">
                    </div>
                  </div>
                </div>
                 <div class="mb-3">
                    <input type="hidden" name="tab" value="tab2">
                    <button type="submit" class="btn btn-primary ajax-post" target-form="add-form">确 定</button>
                    <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);return false;">返 回</button>
                 </div>
                 </form>
              </div>
              
            </div>
          
          
        </div>
      </div>
    </div>
        
  </div>
  
</div>

{include file="public/script"}
</body>
</html>